package com.example.dw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.dw.entity.QR;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 二维码Mapper接口
 * @author system
 * @since 2024-01-01
 */
@Mapper
public interface QRMapper extends BaseMapper<QR> {

    /**
     * 获取所有二维码
     */
    @Select("SELECT * FROM qr ORDER BY createdAt DESC")
    List<QR> getAllQR();

    /**
     * 获取最新的二维码
     */
    @Select("SELECT * FROM qr ORDER BY createdAt DESC LIMIT 1")
    QR getLatestQR();
} 